import cn.hutool.crypto.SecureUtil;

import java.util.HashMap;
import java.util.Map;
import java.util.UUID;

/**
 * @desc:
 * @author: shuangdu
 * @date: 2021/7/13
 * @since: 1.8
 */
public class SendData {

    public static void main(String[] args) {
        Map<String, String> headers = new HashMap<>();
        // your app key
        String appKey = "afbca057dfcf11ebaa3cfa163ef1469d";
        // your app secret
        String appSecret = "93947473fd0d28e8f313f22b4711c7c8";
        // time
        String time = String.valueOf(System.currentTimeMillis());
        // sign
        String sign = SecureUtil.md5(SecureUtil.md5(appKey + time) + appSecret);

        // code
        String code = SecureUtil.md5(UUID.randomUUID().toString() + appKey);

        headers.put("appKey", appKey);
        headers.put("time", time);
        headers.put("sign", sign);
        headers.put("code", code);

        Map<String, String> params = new HashMap<>();
        String data = "{\"QXBM\":440303,\n" +
                "\"QXMC\":\"罗湖区\",\n" +
                "\"YYMC\":\"***系统\",\n" +
                "\"YYTGS\":\"***\",\n" +
                "\"XXBM\":123,\n" +
                "\"XXMC\":\"深圳市**学校\",\n" +
                "\"NJMC\":\"一年级\",\n" +
                "\"BJMC\":\"三班\",\n" +
                "\"XJH\":\"230345\",\n" +
                "\"YHBM\":6547,\n" +
                "\"YHXM\":\"王小川\",\n" +
                "\"DLMC\":\"zxt56432\",\n" +
                "\"DLM\":\"zxt56432\",\n" +
                "\"YHLXBM\":\"01\",\n" +
                "\"YHLXMC\":\"学生\",\n" +
                "\"DLIP\":\"219.134.104.255\",\n" +
                "\"SBH\":\"863254036690765\",\n" +
                "\"DLSJ\":\"2020-10-12 11:34:23\"}";
        params.put("data", data);

        // url
        String url = "https://172.31.129.164:8443/zhkt-api/v1/login/loginInfoAccept";
        String post = HttpUtil.post(url, headers, params);

        System.out.println(post);
    }
}
